package com.util.vmsg.beans;

import java.util.List;

import com.google.appengine.api.datastore.Entity;

public class Person {
	private String emailId;
	private String firstName;
	private String lastName;
	private List<MobileNumber> mobileNumbers;
	private List<Vehicle> ownedVehicles;
	private boolean verifiedEmail;
	private boolean status;
	
	public Entity getPersonEntity()
	{
		Entity personEntity = new Entity("Person",emailId);
		personEntity.setProperty("firstName", firstName);
		personEntity.setProperty("lastName", lastName);
		personEntity.setProperty("verifiedEmail", verifiedEmail);
		personEntity.setProperty("status", status);
		
		int i=0;
		for(MobileNumber mobileNumber : mobileNumbers)
		{
			i++;
			personEntity.setProperty("mobileNumber["+i+"]", mobileNumber.getMobileNumber());
		}
		personEntity.setProperty("mobileListSize",i);
		
		int j=0;
		for(Vehicle vehicle : ownedVehicles)
		{
			j++;
			personEntity.setProperty("vehicle["+j+"]", vehicle.getVehicleNumber());
		}
		personEntity.setProperty("vehicleListSize",j);
		
		
		return personEntity;
	}
	
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public List<MobileNumber> getMobileNumbers() {
		return mobileNumbers;
	}
	public void setMobileNumbers(List<MobileNumber> mobileNumbers) {
		this.mobileNumbers = mobileNumbers;
	}
	public List<Vehicle> getOwnedVehicles() {
		return ownedVehicles;
	}
	public void setOwnedVehicles(List<Vehicle> ownedVehicles) {
		this.ownedVehicles = ownedVehicles;
	}
	public String getEmailId() {
		return emailId;
	}
	public void setEmailId(String emailId) {
		this.emailId = emailId;
	}
	public boolean isVerifiedEmail() {
		return verifiedEmail;
	}
	public void setVerifiedEmail(boolean verifiedEmail) {
		this.verifiedEmail = verifiedEmail;
	}
	public boolean isStatus() {
		return status;
	}
	public void setVehicleOwnerStatus(boolean status) {
		this.status = status;
	}
}
